Managing a Cartridge application | Tarantool
Документация на русском языке
поддерживается сообществом
Справочники Tooling tt CLI utility Commands Managing a Cartridge application

Managing a Cartridge application

$ tt cartridge COMMAND {[OPTION ...]|SUBCOMMAND}

tt cartridge manages a Cartridge application. COMMAND is one of the following:

$ tt cartridge admin ADMIN_FUNC_NAME [ADMIN_OPTION ...]

tt cartridge admin calls admin functions provided by the application.

--name STRING

(Required) An application name.

-l, --list

List the available admin functions.

--instance STRING

A name of the instance to connect to.

--conn STRING

An address to connect to.

--run-dir STRING

A directory where PID and socket files are stored. Defaults to /var/run/tarantool.

Get a list of the available admin functions:

$ tt cartridge admin --name APPNAME --list

   • Available admin functions:

probe  Probe instance

Get help for a specific function:

$ tt cartridge admin --name APPNAME probe --help

   • Admin function "probe" usage:

Probe instance

Args:
  --uri string  Instance URI

Call a function with an argument:

$ tt cartridge admin --name APPNAME probe --uri localhost:3301

   • Probe "localhost:3301": OK

$ tt cartridge bench [BENCH_OPTION ...]

tt cartridge bench runs benchmarks for Tarantool.

--url STRING

A Tarantool instance address (the default is 127.0.0.1:3301).

--user STRING

A username used to connect to the instance (the default is guest).

--password STRING

A password used to connect to the instance.

--connections INT

A number of concurrent connections (the default is 10).

--requests INT

A number of simultaneous requests per connection (the default is 10).

--duration INT

The duration of a benchmark test in seconds (the default is 10).

--keysize INT

The size of a key part of benchmark data in bytes (the default is 10).

--datasize INT

The size of a value part of benchmark data in bytes (the default is 20).

--insert INT

A percentage of inserts (the default is 100).

--select INT

A percentage of selects.

--update INT

A percentage of updates.

--fill INT

A number of records to pre-fill the space (the default is 1000000).

$ tt cartridge failover COMMAND [COMMAND_OPTION ...]

tt cartridge failover manages an application failover. The following commands are available:

  • set
  • setup
  • status
  • disable

$ tt cartridge failover set MODE [FAILOVER_SET_OPTION ...]

Setup failover in the specified mode:

  • stateful
  • eventual
  • disabled

Options:

  • --state-provider STRING: A failover’s state provider. Can be stateboard or etcd2. Used only in the stateful mode.
  • --params STRING: Failover parameters specified in a JSON-formatted string, for example, "{'fencing_timeout': 10', 'fencing_enabled': true}".
  • --provider-params STRING: Failover provider parameters specified in a JSON-formatted string, for example, "{'lock_delay': 14}".

$ tt cartridge failover setup --file STRING

Setup failover with parameters described in a file. The failover configuration file defaults to failover.yml.

The failover.yml file might look as follows:

mode: stateful
state_provider: stateboard
stateboard_params:
    uri: localhost:4401
    password: passwd
failover_timeout: 15

$ tt cartridge failover status

Get the current failover status.

$ tt cartridge failover disable

Disable failover.

--name STRING

An application name. Defaults to «package» in rockspec.

--file STRING

A path to the file containing failover settings. Defaults to failover.yml.

$ tt cartridge repair COMMAND [REPAIR_OPTION ...]

tt cartridge repair repairs a running application. The following commands are available:

  • list-topology
  • remove-instance
  • set-advertise-uri
  • set-leader

$ tt cartridge repair list-topology [REPAIR_OPTION ...]

Get a summary of the current cluster topology.

$ tt cartridge repair remove-instance UUID [REPAIR_OPTION ...]

Remove the instance with the specified UUID from the cluster. If the instance isn’t found, raise an error.

$ tt cartridge repair set-advertise-uri INSTANCE-UUID NEW-URI [REPAIR_OPTION ...]

Change the instance’s advertise URI. Raise an error if the instance isn’t found or is expelled.

$ tt cartridge repair set-leader REPLICASET-UUID INSTANCE-UUID [REPAIR_OPTION ...]

Set the instance as the leader of the replica set. Raise an error in the following cases:

  • There is no replica set or instance with that UUID.
  • The instance doesn’t belong to the replica set.
  • The instance has been disabled or expelled.

The following options work with any repair subcommand:

--name

(Required) An application name.

--data-dir

The directory containing the instances“ working directories. Defaults to /var/lib/tarantool.

The following options work with any repair command, except list-topology:

--run-dir

The directory where PID and socket files are stored. Defaults to /var/run/tarantool.

--dry-run

Launch in dry-run mode: show changes but do not apply them.

--reload

Enable instance configuration to reload after the patch.

$ tt cartridge replicasets COMMAND [COMMAND_OPTION ...]

tt cartridge replicasets manages an application’s replica sets. The following commands are available:

  • setup
  • save
  • list
  • join
  • list-roles
  • list-vshard-groups
  • add-roles
  • remove-roles
  • set-weight
  • set-failover-priority
  • bootstrap-vshard
  • expel

$ tt cartridge replicasets setup [--file FILEPATH] [--bootstrap-vshard]

Setup replica sets using a file.

Options:

  • --file: A file with a replica set configuration. Defaults to replicasets.yml.
  • --bootstrap-vshard: Bootstrap vshard upon setup.

$ tt cartridge replicasets save [--file FILEPATH]

Save the current replica set configuration to a file.

Options:

  • --file: A file to save the configuration to. Defaults to replicasets.yml.

$ tt cartridge replicasets list [--replicaset STRING]

List the current cluster topology.

Options:

  • --replicaset STRING: A replica set name.

$ tt cartridge replicasets join INSTANCE_NAME ... [--replicaset STRING]

Join the instance to a cluster. If a replica set with the specified alias isn’t found in the cluster, it is created. Otherwise, instances are joined to an existing replica set.

Options:

  • --replicaset STRING: A replica set name.

$ tt cartridge replicasets list-roles

List the available roles.

$ tt cartridge replicasets list-vshard-groups

List the available vshard groups.

$ tt cartridge replicasets add-roles ROLE_NAME ... [--replicaset STRING] [--vshard-group STRING]

Add roles to the replica set.

Options:

  • --replicaset STRING: A replica set name.
  • --vshard-group STRING: A vshard group for vshard-storage replica sets.

$ tt cartridge replicasets remove-roles ROLE_NAME ... [--replicaset STRING]

Remove roles from the replica set.

Options:

  • --replicaset STRING: A replica set name.

$ tt cartridge replicasets set-weight WEIGHT [--replicaset STRING]

Specify replica set weight.

Options:

  • --replicaset STRING: A replica set name.

$ tt cartridge replicasets set-failover-priority INSTANCE_NAME ... [--replicaset STRING]

Configure replica set failover priority.

Options:

  • --replicaset STRING: A replica set name.

$ tt cartridge replicasets bootstrap-vshard

Bootstrap vshard.

$ tt cartridge replicasets expel INSTANCE_NAME ...

Expel one or more instances from the cluster.

Нашли ответ на свой вопрос?
Обратная связь